import 'package:fish_redux/fish_redux.dart';
import 'package:kunlun_gas/app_files.dart';

class NbOrderModel {
  final String lateFee;
  final String arrearsFee;
  final String balance;
  final String lastRecordTime;
  final String lastPointNumber;
  final String meterFactory;
  final String gasMeterNo;

  const NbOrderModel({
    this.lastPointNumber,
    this.lateFee,
    this.arrearsFee,
    this.balance,
    this.lastRecordTime,
    this.meterFactory,
    this.gasMeterNo,
  });
}

class NbOrderItemModel {
  final String orderTime;
  final String orderMoney;
  final String orderGas;

  const NbOrderItemModel({
    this.orderGas,
    this.orderMoney,
    this.orderTime,
  });

  static fromJson(json) {
    return NbOrderItemModel(
      orderGas: CommonUtils.checkNullToString(json['RecordUsedValue']),
      orderMoney: CommonUtils.checkNullToString(json['RecordUsedAmount']),
      orderTime: CommonUtils.checkNullToString(json['RecordAddDate']),
    );
  }
}

class NbOrderViewState implements Cloneable<NbOrderViewState> {
  String userID;
  NbOrderModel model;
  String startTime;
  String endTime;
  List<NbOrderItemModel> items;

  EasyRefreshController refreshController = EasyRefreshController();
  int currentPage = 1;

  @override
  NbOrderViewState clone() {
    return NbOrderViewState()
      ..userID = userID
      ..model = model
      ..startTime = startTime
      ..endTime = endTime
      ..items = items
      ..refreshController = refreshController
      ..currentPage = currentPage;
  }
}

NbOrderViewState initState(Map<String, dynamic> args) {
  return NbOrderViewState()..userID = args['userID'];
}
